home *** CD-ROM | disk | FTP | other *** search
/ Final Fantasy the Spirits Within Cardz / Final Fantasy the Spirits Within CD Cardz - Disc 1: Aki Ross.iso / pc / assets / aki-quit.dcr / 00042_button behaviour.ls < prev    next >
Encoding:
Text File  |  2001-07-20  |  10.3 KB  |  368 lines

  1. property my, IncrementValue, HomePosX, HomePosY, friction, ratio, dragging, speedX, speedY, Engaged01, Engaged02, Disengaged01, Disengaged02
  2. global whoIsOccupying
  3.  
  4. on beginSprite me
  5.   Initialize(me)
  6. end
  7.  
  8. on Initialize me
  9.   my = me.spriteNum
  10.   sprite(my).moveableSprite = 1
  11.   if my = 151 then
  12.     HomePosX = 60
  13.     HomePosY = 24
  14.   else
  15.     if my = 152 then
  16.       HomePosX = 100
  17.       HomePosY = 24
  18.     else
  19.       if my = 153 then
  20.         HomePosX = 140
  21.         HomePosY = 24
  22.       else
  23.         if my = 154 then
  24.           HomePosX = 180
  25.           HomePosY = 24
  26.         else
  27.           if my = 155 then
  28.             HomePosX = 220
  29.             HomePosY = 24
  30.           else
  31.             if my = 156 then
  32.               HomePosX = 260
  33.               HomePosY = 24
  34.             end if
  35.           end if
  36.         end if
  37.       end if
  38.     end if
  39.   end if
  40.   friction = 0.69999999999999996
  41.   ratio = 0.29999999999999999
  42.   dragging = 0
  43.   speedX = 0
  44.   speedY = 0
  45.   if whoIsOccupying <> 0 then
  46.     set the locH of sprite whoIsOccupying to 526
  47.     set the locV of sprite whoIsOccupying to 19
  48.     set the blend of sprite whoIsOccupying to 0
  49.     puppetSprite(150, 1)
  50.     set the ink of sprite 150 to 36
  51.     set the memberNum of sprite 150 to the number of member "transition08"
  52.     set the locH of sprite 150 to the locH of sprite whoIsOccupying
  53.     set the locV of sprite 150 to the locV of sprite whoIsOccupying
  54.   end if
  55. end
  56.  
  57. on exitFrame me
  58.   update(me)
  59. end
  60.  
  61. on update me
  62.   if whoIsOccupying <> my then
  63.     if dragging = 0 then
  64.       speedX = (speedX * friction) + ((HomePosX - sprite(my).locH) * ratio)
  65.       speedY = (speedY * friction) + ((HomePosY - sprite(my).locV) * ratio)
  66.       sprite(my).locH = sprite(my).locH + speedX
  67.       sprite(my).locV = sprite(my).locV + speedY
  68.     end if
  69.   end if
  70. end
  71.  
  72. on mouseEnter me
  73.   if my = 151 then
  74.     sprite(141).visible = 1
  75.   else
  76.     if my = 152 then
  77.       sprite(142).visible = 1
  78.     else
  79.       if my = 153 then
  80.         sprite(143).visible = 1
  81.       else
  82.         if my = 154 then
  83.           sprite(144).visible = 1
  84.         else
  85.           if my = 155 then
  86.             sprite(145).visible = 1
  87.           else
  88.             if my = 156 then
  89.               sprite(146).visible = 1
  90.             end if
  91.           end if
  92.         end if
  93.       end if
  94.     end if
  95.   end if
  96.   cursor(280)
  97. end
  98.  
  99. on mouseLeave me
  100.   if my = 151 then
  101.     sprite(141).visible = 0
  102.   else
  103.     if my = 152 then
  104.       sprite(142).visible = 0
  105.     else
  106.       if my = 153 then
  107.         sprite(143).visible = 0
  108.       else
  109.         if my = 154 then
  110.           sprite(144).visible = 0
  111.         else
  112.           if my = 155 then
  113.             sprite(145).visible = 0
  114.           else
  115.             if my = 156 then
  116.               sprite(146).visible = 0
  117.             end if
  118.           end if
  119.         end if
  120.       end if
  121.     end if
  122.   end if
  123.   cursor(-1)
  124. end
  125.  
  126. on mouseDown me
  127.   dragging = 1
  128.   repeat while the stillDown
  129.     sprite(my).locH = the mouseH
  130.     sprite(my).locV = the mouseV
  131.     sprite(my).blend = 100
  132.     if whoIsOccupying = my then
  133.       sprite(150).visible = 0
  134.     end if
  135.     updateStage()
  136.   end repeat
  137.   if whoIsOccupying = my then
  138.     if inside(point(the mouseH, the mouseV), the rect of sprite 140) then
  139.       sprite(150).visible = 1
  140.       sprite(my).blend = 0
  141.     end if
  142.   end if
  143. end
  144.  
  145. on mouseUp me
  146.   if whoIsOccupying = my then
  147.     if inside(point(the mouseH, the mouseV), the rect of sprite 140) = 0 then
  148.       if my = 151 then
  149.         Disengaged01 = "TrailerDisengaged01"
  150.         Disengaged02 = "TrailerDisengaged02"
  151.         disengagedWarning(me)
  152.       else
  153.         if my = 152 then
  154.           Disengaged01 = "ProfileDisengaged01"
  155.           Disengaged02 = "ProfileDisengaged02"
  156.           disengagedWarning(me)
  157.         else
  158.           if my = 153 then
  159.             Disengaged01 = "PhotoDisengaged01"
  160.             Disengaged02 = "PhotoDisengaged02"
  161.             disengagedWarning(me)
  162.           else
  163.             if my = 154 then
  164.               Disengaged01 = "SoundtrackDisengaged01"
  165.               Disengaged02 = "SoundtrackDisengaged02"
  166.               disengagedWarning(me)
  167.             else
  168.               if my = 155 then
  169.                 Disengaged01 = "SoundtrackDisengaged01"
  170.                 Disengaged02 = "SoundtrackDisengaged02"
  171.                 disengagedWarning(me)
  172.               else
  173.                 if my = 156 then
  174.                   Disengaged01 = "VGDisengaged01"
  175.                   Disengaged02 = "VGDisengaged02"
  176.                   disengagedWarning(me)
  177.                 end if
  178.               end if
  179.             end if
  180.           end if
  181.         end if
  182.       end if
  183.       whoIsOccupying = 0
  184.       dragging = 0
  185.     end if
  186.   else
  187.     if whoIsOccupying = 0 then
  188.       if inside(point(the mouseH, the mouseV), the rect of sprite 140) then
  189.         sprite(my).locH = 526
  190.         sprite(my).locV = 19
  191.         updateStage()
  192.         sprite(my).blend = 0
  193.         sprite(150).visible = 1
  194.         puppetSprite(150, 1)
  195.         set the ink of sprite 150 to 36
  196.         set the memberNum of sprite 150 to the number of member "transition01"
  197.         set the locH of sprite 150 to sprite(my).locH
  198.         set the locV of sprite 150 to sprite(my).locV
  199.         startTimer()
  200.         repeat while the timer < 5
  201.           updateStage()
  202.         end repeat
  203.         puppetSprite(150, 1)
  204.         set the ink of sprite 150 to 36
  205.         set the memberNum of sprite 150 to the number of member "transition02"
  206.         set the locH of sprite 150 to sprite(my).locH
  207.         set the locV of sprite 150 to sprite(my).locV
  208.         startTimer()
  209.         repeat while the timer < 5
  210.           updateStage()
  211.         end repeat
  212.         puppetSprite(150, 1)
  213.         set the ink of sprite 150 to 36
  214.         set the memberNum of sprite 150 to the number of member "transition03"
  215.         set the locH of sprite 150 to sprite(my).locH
  216.         set the locV of sprite 150 to sprite(my).locV
  217.         startTimer()
  218.         repeat while the timer < 5
  219.           updateStage()
  220.         end repeat
  221.         puppetSprite(150, 1)
  222.         set the ink of sprite 150 to 36
  223.         set the memberNum of sprite 150 to the number of member "transition04"
  224.         set the locH of sprite 150 to sprite(my).locH
  225.         set the locV of sprite 150 to sprite(my).locV
  226.         startTimer()
  227.         repeat while the timer < 5
  228.           updateStage()
  229.         end repeat
  230.         puppetSprite(150, 1)
  231.         set the ink of sprite 150 to 36
  232.         set the memberNum of sprite 150 to the number of member "transition05"
  233.         set the locH of sprite 150 to sprite(my).locH
  234.         set the locV of sprite 150 to sprite(my).locV
  235.         startTimer()
  236.         repeat while the timer < 5
  237.           updateStage()
  238.         end repeat
  239.         puppetSprite(150, 1)
  240.         set the ink of sprite 150 to 36
  241.         set the memberNum of sprite 150 to the number of member "transition06"
  242.         set the locH of sprite 150 to sprite(my).locH
  243.         set the locV of sprite 150 to sprite(my).locV
  244.         startTimer()
  245.         repeat while the timer < 5
  246.           updateStage()
  247.         end repeat
  248.         puppetSprite(150, 1)
  249.         set the ink of sprite 150 to 36
  250.         set the memberNum of sprite 150 to the number of member "transition07"
  251.         set the locH of sprite 150 to sprite(my).locH
  252.         set the locV of sprite 150 to sprite(my).locV
  253.         startTimer()
  254.         repeat while the timer < 5
  255.           updateStage()
  256.         end repeat
  257.         puppetSprite(150, 1)
  258.         set the ink of sprite 150 to 36
  259.         set the memberNum of sprite 150 to the number of member "transition08"
  260.         set the locH of sprite 150 to sprite(my).locH
  261.         set the locV of sprite 150 to sprite(my).locV
  262.         startTimer()
  263.         repeat while the timer < 5
  264.           updateStage()
  265.         end repeat
  266.         whoIsOccupying = my
  267.         if my = 151 then
  268.           Engaged01 = "TrailerEngaged01"
  269.           Engaged02 = "TrailerEngaged02"
  270.           engagedWarning(me)
  271.           play movie "Ryan-Main"
  272.         else
  273.           if my = 152 then
  274.             Engaged01 = "ProfileEngaged01"
  275.             Engaged02 = "ProfileEngaged02"
  276.             engagedWarning(me)
  277.             play movie "Ryan-Profile"
  278.           else
  279.             if my = 153 then
  280.               Engaged01 = "PhotoEngaged01"
  281.               Engaged02 = "PhotoEngaged02"
  282.               engagedWarning(me)
  283.               play movie "Ryan-Photogallery"
  284.             else
  285.               if my = 154 then
  286.                 Engaged01 = "SoundtrackEngaged01"
  287.                 Engaged02 = "SoundtrackEngaged02"
  288.                 engagedWarning(me)
  289.                 play movie "Ryan-Soundtrack"
  290.               else
  291.                 if my = 155 then
  292.                   Engaged01 = "PuzzleEngaged01"
  293.                   Engaged02 = "PuzzleEngaged02"
  294.                   engagedWarning(me)
  295.                   play movie "Ryan-Puzzle"
  296.                 else
  297.                   if my = 156 then
  298.                     Engaged01 = "VGEngaged01"
  299.                     Engaged02 = "VGEngaged02"
  300.                     engagedWarning(me)
  301.                     play movie "Ryan-Vehicles&Gear"
  302.                   end if
  303.                 end if
  304.               end if
  305.             end if
  306.           end if
  307.         end if
  308.       else
  309.         dragging = 0
  310.         sprite(my).blend = 100
  311.       end if
  312.     else
  313.       dragging = 0
  314.       sprite(my).blend = 100
  315.     end if
  316.   end if
  317. end
  318.  
  319. on engagedWarning me
  320.   puppetSound(1, "engager")
  321.   i = 1
  322.   repeat while i < 5
  323.     puppetSprite(170, 1)
  324.     set the memberNum of sprite 170 to the number of member Engaged01
  325.     set the ink of sprite 170 to 36
  326.     set the loc of sprite 170 to point(400, 240)
  327.     startTimer()
  328.     repeat while the timer < 15
  329.       updateStage()
  330.     end repeat
  331.     puppetSprite(170, 1)
  332.     set the memberNum of sprite 170 to the number of member Engaged02
  333.     set the ink of sprite 170 to 36
  334.     set the loc of sprite 170 to point(400, 240)
  335.     startTimer()
  336.     repeat while the timer < 15
  337.       updateStage()
  338.     end repeat
  339.     i = i + 1
  340.   end repeat
  341.   puppetSprite(170, 0)
  342. end
  343.  
  344. on disengagedWarning me
  345.   puppetSound(1, "engager")
  346.   i = 1
  347.   repeat while i < 5
  348.     puppetSprite(170, 1)
  349.     set the memberNum of sprite 170 to the number of member Disengaged01
  350.     set the ink of sprite 170 to 36
  351.     set the loc of sprite 170 to point(400, 240)
  352.     startTimer()
  353.     repeat while the timer < 15
  354.       updateStage()
  355.     end repeat
  356.     puppetSprite(170, 1)
  357.     set the memberNum of sprite 170 to the number of member Disengaged02
  358.     set the ink of sprite 170 to 36
  359.     set the loc of sprite 170 to point(400, 240)
  360.     startTimer()
  361.     repeat while the timer < 15
  362.       updateStage()
  363.     end repeat
  364.     i = i + 1
  365.   end repeat
  366.   puppetSprite(170, 0)
  367. end
  368.